
#查看Sqoop Export导出文档
# 1.各省市的点击次数和曝光次数统计 （包括正常流量和异常流量）
/opt/module/sqoop/bin/sqoop export \
--connect "jdbc:mysql://node101:3306/jtp_ads_report?useUnicode=true&characterEncoding=utf8" \
--username root \
--password 123456 \
--table ads_region_city_ads_report \
--export-dir /user/spark/warehouse/jtp_ads_warehouse/ads_region_city_ads_report \
--input-fields-terminated-by "\001" \
--update-mode allowinsert \
--update-key "dt,province,city,is_invalid_traffic" \
--input-null-string '\\N' \
--input-null-non-string '\\N' \
--num-mappers 1

# 2.各广告平台的点击次数和曝光次数统计 （包括正常流量和异常流量）
/opt/module/sqoop/bin/sqoop export \
--connect "jdbc:mysql://node101:3306/jtp_ads_report?useUnicode=true&characterEncoding=utf-8" \
--username root \
--password 123456 \
--table ads_platform_ads_report \
--export-dir /user/spark/warehouse/jtp_ads_warehouse/ads_platform_ads_report \
--input-fields-terminated-by "\001" \
--update-mode allowinsert \
--update-key "dt,platform_id,platform_name_zh,is_invalid_traffic" \
--input-null-string '\\N' \
--input-null-non-string '\\N' \
--num-mappers 1


# 3.各操作系统的点击次数和曝光次数统计 （包括正常流量和异常流量）
/opt/module/sqoop/bin/sqoop export \
--connect "jdbc:mysql://node101:3306/jtp_ads_report?useUnicode=true&characterEncoding=utf-8" \
--username root \
--password 123456 \
--table ads_os_type_ads_report \
--export-dir /user/spark/warehouse/jtp_ads_warehouse/ads_os_type_ads_report \
--input-fields-terminated-by '\001' \
--update-mode allowinsert \
--update-key "dt,client_os_type,is_invalid_traffic" \
--input-null-string '\\N' \
--input-null-non-string '\\N' \
--num-mappers 1


# 4.各广告在每个小时的点击次数和曝光次数统计 （包括正常流量和异常流量）
/opt/module/sqoop/bin/sqoop export \
--connect "jdbc:mysql://node101:3306/jtp_ads_report?useUnicode=true&characterEncoding=utf-8" \
--username root \
--password 123456 \
--table ads_platform_hour_ads_report \
--export-dir /user/spark/warehouse/jtp_ads_warehouse/ads_platform_hour_ads_report \
--input-fields-terminated-by '\001' \
--update-mode allowinsert \
--update-key "ad_id,ads_name,hour(from_unixtime(event_time/1000)),is_invalid_traffic" \
--input-null-string '\\N' \
--input-null-non-string '\\N' \
--num-mappers 1


